﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="View.aspx.cs" Inherits="IDML.Web.Modules.Patient.View" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
    <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <script type="text/javascript">
        $(function () {
            $("#tabs").tabs();
        });
    </script>

<%--
<script type="text/javascript" src="../../Scripts/jquery.min.js"></script>--%>

    <script type="text/javascript" src="../../Scripts/thickbox-compressed.js"></script>

      <link href="../../Styles/thickbox.css" type="text/css" rel="stylesheet" />

    <script type="text/C#" runat="server">    
        protected void Refresh_Click(object sender, EventArgs args)
        {
            //  update the grids contents
            this.gwPatientTest.DataBind();
        }    
    </script>

   <script type="text/javascript">
        function updated() {
            //  close the popup
            tb_remove();
            //  refresh the update panel so we can view the changes  
            $('#<%= this.btnRefreshTests.ClientID %>').click();
        }
        function pageLoad(sender, args) {
            if (args.get_isPartialLoad()) {
                //  reapply the thick box stuff
                tb_init('a.thickbox');
            }
        }        
    </script>






</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Patient Profile</a></li>
            <li><a href="#tabs-2">Billing</a></li>
            <li><a href="#tabs-3">Test Results Entry</a></li>
        </ul>
        <div id="tabs-1">
            <asp:Label ID="LabelFN" runat="server" Text="Label">First Name : </asp:Label>
            <asp:Label ID="lblFirstName" runat="server" Text="Label"></asp:Label>
            <br />
            <asp:Label ID="LabelLN" runat="server" Text="Label">Last Name : </asp:Label>
            <asp:Label ID="lblLastName" runat="server" Text="Label"></asp:Label>
            <br />
            <asp:Label ID="LabelPN" runat="server" Text="Label">Phone No : </asp:Label>
            <asp:Label ID="lblPhoneNumber" runat="server" Text="Label"></asp:Label>
            <br />
            <asp:Label ID="LabelAge" runat="server" Text="Label">Age : </asp:Label>
            <asp:Label ID="lblAge" runat="server" Text="Label"></asp:Label>
        </div>
        <div id="tabs-2">
            <asp:Label ID="Label1" runat="server" Text="Test Code : "></asp:Label>
            <asp:TextBox ID="txtTestCode" runat="server"></asp:TextBox>
            <asp:Button ID="btnAddTestPay" runat="server" Text="Add" OnClick="btnAddTestPay_Click" />
            <br />
            <br />
              <asp:Button ID="btnRefreshTests" runat="server" Style="display: none" OnClick="Refresh_Click" />
            <asp:GridView ID="gwPaymentView" DataKeyNames="TestId" OnRowDeleting="gwPaymentView_RowDeleting"
                AutoGenerateColumns="false" runat="server">
                <Columns>
                    <asp:BoundField DataField="TestId" HeaderText="TestId" Visible="false" ReadOnly="true" />
                    <asp:BoundField DataField="TestFeeStructureId" HeaderText="TestFeeStructureId" Visible="false" />
                    <asp:BoundField DataField="TestCode" HeaderText="Test Code" />
                    <asp:BoundField DataField="TestName" HeaderText="Test Name" />
                    <asp:BoundField DataField="Amount" HeaderText="Amount" />
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <%--<asp:ImageButton ID="imgBtnDel" runat="server" CommandName="Delete" ImageUrl="~/Images/icon_delete.png" />--%>
                            <asp:LinkButton ID="LB" CommandName="Delete" runat="server">Delete</asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            <br />
            <asp:Label ID="lblTotAmount" runat="server" Text="Total Amoutn (Rs.) : "></asp:Label>
            <b>
                <asp:Label ID="lblTotAmt" runat="server"></asp:Label></b>
            <br />
            <asp:Label ID="lblAmtPaid" runat="server" Text="Amount Paid (Rs.) : "></asp:Label>
            <asp:TextBox ID="txtAmtPaid" runat="server"></asp:TextBox>
            <asp:Button ID="btnPay" runat="server" Text="Pay" onclick="btnPay_Click" />
        </div>
        <div id="tabs-3">
            <asp:GridView ID="gwPatientTest" DataKeyNames="TestId"  AutoGenerateColumns="false" runat="server">
                <Columns>
                    <asp:BoundField DataField="PatientId" HeaderText="PatientId" Visible="false" ReadOnly="true" />
                    <asp:BoundField DataField="TestId" HeaderText="TestId" Visible="false" ReadOnly="true" />
                    <asp:BoundField DataField="TestCode" HeaderText="Test Code" />
                    <asp:BoundField DataField="TestName" HeaderText="Test Name" />
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>                            
                           <%-- <asp:LinkButton ID="LB" runat="server">Enter Results</asp:LinkButton>--%>
                       
     <%--                  
                <a id="btnShowPopup" runat="server" class="thickbox" 
                href='<%# Eval("TestId", "TestResult.aspx?TestId={0}&PatientId={1}&TB_iframe=true&height=250&width=500") %>'>
                                    Enter Results</a>  --%>            
                       
                           
                <a id="btnShowPopup" runat="server" class="thickbox" 
                href='<%# string.Format("TestResult.aspx?TestId={0}&PatientId={1}&TB_iframe=true&height=250&width=500",
                    HttpUtility.UrlEncode(Eval("TestId").ToString()), 
                    HttpUtility.UrlEncode(Eval("PatientId").ToString()))%>'>
                                    Enter Results</a>                
                       
                       
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>
